package demo1;
import org.w3c.dom.ls.LSOutput;
public class Test {
    public static void main(String[] args) {
        Outer05 outer05 = new Outer05();
        outer05.f1();
        System.out.println(outer05);
    }
}
class Outer05{
    private int n1 = 99;
    public void f1(){
        person p = new person(){
            int n1= 88;
            @Override
            public void hi() {
                System.out.println("匿名内部类重写方法  "+Outer05.this);
            }
        };
        p.hi();

        new person(){
            @Override
            public void hi() {
                System.out.println("匿名内部类重写方法,没有接收值");
            }
        }.hi();
    }
}
class person{
    public void hi(){
        System.out.println("这个是我们的一个方法");
    }
}
